package com.whereareyou.model;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by 家玮 on 2014/7/26.
 */
@Entity
@IdClass(value=RelationshipPK.class)
@Table(name = "RELATIONSHIP")
public class Relationship {
    @Id
    public String getUser1() {
        return user1;
    }

    public void setUser1(String user1) {
        this.user1 = user1;
    }
    @Id
    public String getUser2() {
        return user2;
    }

    public void setUser2(String user2) {
        this.user2 = user2;
    }
    @Column(name="USER1_NICKNAME")
    public String getUser1Nickname() {
        return user1Nickname;
    }

    public void setUser1Nickname(String user1Nickname) {
        this.user1Nickname = user1Nickname;
    }
    @Column(name="USER2_NICKNAME")
    public String getUser2Nickname() {
        return user2Nickname;
    }

    public void setUser2Nickname(String user2Nickname) {
        this.user2Nickname = user2Nickname;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "DATE_CREATED")
    public Date getDateCreated() {
        return dateCreated;
    }

    public void setDateCreated(Date dateCreated) {
        this.dateCreated = dateCreated;
    }

    private String user1;
    private String user2;
    private String user1Nickname;
    private String user2Nickname;
    private Date dateCreated;

}
